<template>
<h1>双向绑定指令</h1>
<input type="text" v-model="info">
  <button @click="console.log(info)">获取信息</button>

  <h3>用户登录</h3>
  <input type="text" placeholder="请输入用户名" v-model="user.name">
  <br>
  <input type="password" placeholder="请输入密码" v-model="user.password"><br>
  <br>
  性别：
  <input type="radio" name="sex" value="1" v-model="user.gender">男
  <input type="radio" name="sex" value="0" v-model="user.gender">女
  <br>
  <button @click="login">登录</button>

</template>
<script setup>
import {ref} from "vue";

const info = ref('')

const user = ref({
  name: '',
  password: '',
  gender: ''
});
const login = () => {
  console.log(user.value);
}
</script>


<style scoped>

</style>